package solution

func V1(x int) int {
	y := 0

	for x != 0 {
		y = y*10 + x%10

		if y <= -1<<31 || y >= 1<<31-1 {
			return 0
		}

		x /= 10
	}

	return y
}
